﻿///<reference path="../../../Scripts/jquery-1.4.1-vsdoc.js"/>
///<reference path="../utils/Utils.js"/>

// Новый / Старый Завет
function BibleTestament(title) {

    this.Title = title;
    this.Books = new Dictionary();

    this.AddBook = function (key, title, chaptersCount) {
        return this.Books.Lookup(this.Books.Add(key, new BibleBook(key, title, chaptersCount)));
    }

    this.Search = function (searchPattern) {
        var results = [];
        for (var i = 0; i < this.Books.Keys.length; i++) {
            var book = this.Books.Lookup(this.Books.Keys[i]);
            AddRange(results, book.Search(searchPattern));
        }
        return results;
    }
}
